<template>
  <view>
    <u-navbar :is-back="false" title="数据"
      title-size="30"
      :background="{background:'#2B88FE' }"
      title-color="#fff">
      <div class="head_icon">
        <u-icon @click="$api.handleBackTo"
          name="arrow-left" color="#fff"
          size="36">
        </u-icon>
        <u-icon @click="$api.handleHomeTo"
          name="home" color="#fff" size="36">
        </u-icon>
      </div>
    </u-navbar>
    <CommDetail :cid="cid" :info="info"
      :current="2">
      <view class="cons whiteBg">
        <view class="x-row totalrow">
          <view
            class="x-col x-col-center rightBor">
            <view class="tname">
              总进货数量
            </view>
            <view class="tnum">
              {{info.fBuyCount}}
            </view>
          </view>

          <view class="x-col x-col-center">
            <view class="tname">
              总进货额
            </view>
            <view class="tnum">
              <u-count-to decimals="2"
                :end-val="info.fBuyMoney"
                color="#111111" font-size="48">
              </u-count-to>

            </view>
          </view>
        </view>
      </view>
      <view class="goodBox whiteBg">
        <view class="gtit">
          进货详情
        </view>
        <u-empty text="暂无数据" mode="list"
          v-if="!form.list.length">
        </u-empty>
        <view class="glist x-row borderBottom"
          v-for="(g,index) in form.list"
          :key="index">
          <view class="x-col-center">
            <image :src="$api.ProImg(g.fProId)" class="gimg">
            </image>
          </view>
          <view class="x-col">
            <view class="gname ellipsis">
              {{g.fProName}}
            </view>
            <view class="num">
              进货数量：{{g.fCount}}
            </view>
          
            <view class="x-col num">
			  采购时间：{{g.fCreateTime}}
			 </view>  
              <view class="price">
                <text>￥</text>{{g.fPrice}}
              </view>
            </view>
          </view>
        </view>
      </view>

    </CommDetail>
  </view>
</template>

<script>
import CommDetail from './commdetail'
export default {
  components: { CommDetail },
  data() {
    return {
      cid: 0,
      info: {},
      form: {
        totalNum: 0,
        total: 0,
        list: []
      },
	  formdata:{
		  MrkId:0,
		  Type:1
	  }
    }
  },
  onLoad(e) {
    this.cid = Number(e.id)
    this.$axios('api/MrkBasic/GetDetail', 'post', {
      value: e.id
    })
      .then(res => {
        this.info = res.Value
        this.loading = false
        return res.Value
      })
      .then(res => {
	    this.formdata.MrkId=res.fId
        this.$axios('api/MrkProInOutLog/ListPaged', 'post', { value: this.formdata }).then(
          res => {
            this.form.list = res.Value.List
          }
        )
      })
  }
}
</script>

<style lang="scss" scoped>
page {
  padding: 0 20rpx;
}
.goodBox {
  padding-left: 24rpx;
  box-sizing: border-box;
  .gtit {
    font-size: 32rpx;
    font-weight: 500;
    color: #333333;
    line-height: 44rpx;
    padding: 18rpx 8rpx;
  }
  .glist {
    padding: 32rpx 32rpx 32rpx 0;
    box-sizing: border-box;
    .gimg {
      width: 144rpx;
      height: 144rpx;
      margin-right: 24rpx;
    }
    .gname {
      font-size: 32rpx;
      font-weight: 500;
      color: #000000;
      line-height: 30rpx;
      height: 80rpx;
    }
    .num {
      font-size: 28rpx;
      font-weight: 400;
      color: #666666;
      line-height: 24rpx;
    }
    .price {
      font-size: 32rpx;
      font-weight: bold;
      color: #000000;
      line-height: 40rpx;
      text {
        font-size: 24rpx;
      }
    }
  }
}
.totalrow {
  margin: 20rpx 0;
  padding: 40rpx 0;
  text-align: center;
  .tname {
    font-size: 28rpx;
    font-weight: 400;
    color: #999999;
    line-height: 44rpx;
  }
  .tnum {
    font-size: 48rpx;
    font-weight: 500;
    color: #111111;
    line-height: 64rpx;
  }
}
</style>